package jmine.tec.hydra.actions.domain;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Transient;

import jmine.tec.persist.annotation.Alias;
import jmine.tec.persist.annotation.UniqueConstraint;

import org.hibernate.annotations.Filter;
import org.hibernate.annotations.Filters;

import bancosys.tec.component.Documentation;
import bancosys.tec.persist.bussobj.AuthPersistableBusinessObject;
import bancosys.tec.persist.persister.annotation.NaturalKey;
import bancosys.tec.persist.validator.ValidationError;

/**
 * @author lundberg
 */
@Entity
@Table(name = "MOCK_AUTH_ENTITY")
@Alias("MOAUEN")
@SequenceGenerator(name = "SEQ_MOAUEN", sequenceName = "SEQ_MOAUEN")
@Filters({ @Filter(name = "authFilter", condition = "auth = :auth") })
@Documentation("TABELA DE TESTES.")
@UniqueConstraint(name = "AK_MOAUEN_1", columns = { "AUTH", "MNE" })
public class MockAuthorizableEntity extends AuthPersistableBusinessObject {

    private Long id;

    private String mnemonico;

    private ValidationError validationError;

    private RuntimeException validationException;

    @Id
    @GeneratedValue(strategy = GenerationType.AUTO, generator = "SEQ_MOAUEN")
    @Column(name = "COD_MOAUEN", nullable = false)
    @Documentation("TABELA DE TESTES.")
    public Long getId() {
        return this.id;
    }

    /**
     * @return the mnemonico
     */
    @NaturalKey
    @Column(name = "MNE", nullable = false)
    @Documentation("TABELA DE TESTES.")
    public String getMnemonico() {
        return this.mnemonico;
    }

    /**
     * @return the validationError
     */
    @Transient
    public ValidationError getValidationError() {
        return this.validationError;
    }

    /**
     * @return the validationException
     */
    @Transient
    public RuntimeException getValidationException() {
        return this.validationException;
    }

    /**
     * @param id the id to set
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * @param mnemonico the mnemonico to set
     */
    public void setMnemonico(String mnemonico) {
        this.mnemonico = mnemonico;
    }

    /**
     * @param validationError the validationError to set
     */
    public void setValidationError(ValidationError validationError) {
        this.validationError = validationError;
    }

    /**
     * @param validationException the validationException to set
     */
    public void setValidationException(RuntimeException validationException) {
        this.validationException = validationException;
    }
}
